import { Form } from "@/components/layout/form/form";
import { IMAGES, SELECT, TEXT, CHECKBOX, TEXTAREA } from "@/utils/enums/type-enums";
import Storage from "@/utils/storage";
import { ACCESS_TOKEN_KEY } from "@/utils/enums/cache-enum";
export const productAddForms: Form[] = [
  {
    label: null,
    card: [
      { type: TEXT, label: '公司名称', name: 'names', span: 5, placeholder: '请输入公司名称' },
      { type: TEXT, label: '公司编码', name: 'code', span: 5, placeholder: '请输入公司编码' },
      { line: true },
      { type: TEXT, label: '联系人', name: 'contacts', span: 5, placeholder: '请输入联系人' },
      { type: TEXT, label: '联系方式', name: 'telephone', span: 5, placeholder: '请输入联系方式' },
      { line: true },
      { type: SELECT, label: '公司性质', name: 'natureCode', span: 5, options: [] },
      { type: SELECT, label: '公司类别', name: 'customerType', span: 5, options: [] },
      { line: true },
      { type: TEXTAREA, label: '公司地址', name: 'address', style: 'width: 400px', span: 5, placeholder: '请输入公司地址' },
      { line: true },
      { type: TEXTAREA, label: '备注', name: 'remark', span: 15, style: 'width: 400px', placeholder: '请输入备注' },
    ]
  }
]

export const productAddRules = {
  names: [{ required: true, message: '公司名称必须4-100位', trigger: 'blur', min: 4, max: 100 }],
  code: [{ required: true, message: '公司编码不能为空', trigger: 'blur' }],
  contacts: [{ required: true, message: '联系人不能为空', trigger: 'blur' }],
  telephone: [{ required: true, message: '联系方式必须11位', trigger: 'blur', min: 11 }],
  natureCode: [{ required: true, message: '请选择公司性质', trigger: 'blur' }],
  customerType: [{ required: true, message: '请选择公司类别', trigger: 'blur' }],
}